package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 水质告警数据表
 * @TableName water_quality_anomaly
 */
@TableName(value ="water_quality_anomaly")
@Data
public class WaterQualityAnomaly implements Serializable {
    /**
     * 告警ID
     */
    @TableId(type = IdType.AUTO)
    private Long anomalyId;
    

    /**
     * 设备ID
     */
    private String deviceId;

    /**
     * 数据ID
     */
    private Long dataId;

    /**
     * 告警指标
     */
    private String indicatorCode;

    /**
     * 当前值
     */
    private BigDecimal currentValue;

    /**
     * 正常范围
     */
    private String normalRange;

    /**
     * 告警类型：1-超标，2-突变，3-缺失
     */
    private Integer anomalyType;

    /**
     * 严重程度：1-轻微，2-中等，3-严重
     */
    private Integer severity;

    /**
     * 告警状态：1-未处理，2-已确认，3-已处理，4-已关闭（假删除）
     */
    private Integer handleStatus;

    /**
     * 创建时间
     */
    private Date createTime;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WaterQualityAnomaly other = (WaterQualityAnomaly) that;
        return (this.getAnomalyId() == null ? other.getAnomalyId() == null : this.getAnomalyId().equals(other.getAnomalyId()))
            && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getDataId() == null ? other.getDataId() == null : this.getDataId().equals(other.getDataId()))
            && (this.getIndicatorCode() == null ? other.getIndicatorCode() == null : this.getIndicatorCode().equals(other.getIndicatorCode()))
            && (this.getCurrentValue() == null ? other.getCurrentValue() == null : this.getCurrentValue().equals(other.getCurrentValue()))
            && (this.getNormalRange() == null ? other.getNormalRange() == null : this.getNormalRange().equals(other.getNormalRange()))
            && (this.getAnomalyType() == null ? other.getAnomalyType() == null : this.getAnomalyType().equals(other.getAnomalyType()))
            && (this.getSeverity() == null ? other.getSeverity() == null : this.getSeverity().equals(other.getSeverity()))
            && (this.getHandleStatus() == null ? other.getHandleStatus() == null : this.getHandleStatus().equals(other.getHandleStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAnomalyId() == null) ? 0 : getAnomalyId().hashCode());
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getDataId() == null) ? 0 : getDataId().hashCode());
        result = prime * result + ((getIndicatorCode() == null) ? 0 : getIndicatorCode().hashCode());
        result = prime * result + ((getCurrentValue() == null) ? 0 : getCurrentValue().hashCode());
        result = prime * result + ((getNormalRange() == null) ? 0 : getNormalRange().hashCode());
        result = prime * result + ((getAnomalyType() == null) ? 0 : getAnomalyType().hashCode());
        result = prime * result + ((getSeverity() == null) ? 0 : getSeverity().hashCode());
        result = prime * result + ((getHandleStatus() == null) ? 0 : getHandleStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", anomalyId=").append(anomalyId);
        sb.append(", deviceId=").append(deviceId);
        sb.append(", dataId=").append(dataId);
        sb.append(", indicatorCode=").append(indicatorCode);
        sb.append(", currentValue=").append(currentValue);
        sb.append(", normalRange=").append(normalRange);
        sb.append(", anomalyType=").append(anomalyType);
        sb.append(", severity=").append(severity);
        sb.append(", handleStatus=").append(handleStatus);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}